package user;
import interfaces.TaskI;

import java.io.*;


class TaskReadText<IN,OUT> implements TaskI<IN,OUT> {

BufferedReader br;  
String line;

  public TaskReadText(String fname) {
    try {
      // open file 
      br = new BufferedReader(new FileReader(fname));
      System.out.println("File opened: "+fname);
    } catch (IOException e) {
      System.out.println("File read error "+fname);
    }
  }

@Override
// line-by-line reading from file
public OUT process(IN in) {
	try {
	      if (br.ready()) return (OUT) ("<"+br.readLine()+">\n");
	      else return null;
	    } catch (IOException e) {
	      return null;
	    }

}
}
